package cv.vender.para;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zhouwenjing on 2016/12/20.
 * .
 */


public class clsCalibrationPara
{
    public final static int COUNT=20;
    public final static int MAX_COUNTERPOISE=10000;
    private static List<clsCalibrationPara> lst=new ArrayList<>();
    private int adc;
    private int k;//系数
    private int b;//常数

    public static List<clsCalibrationPara> getLst() {
        return lst;
    }

    public static void setLst(List<clsCalibrationPara> lst) {
        clsCalibrationPara.lst = lst;
    }


    public void CalculateCalibrationPara(clsADCPara para1,clsADCPara para2)
    {
        this.adc=para2.getAdVal();
        this.k=(para2.getCounterpoise()-para1.getCounterpoise())*1000/(para2.getAdVal()-para1.getAdVal());
        this.b=para1.getCounterpoise()-this.k*para1.getAdVal()/1000;
    }


    public int getAdc() {
        return adc;
    }

    public void setAdc(int adc) {
        this.adc = adc;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    public int getK() {
        return k;
    }

    public void setK(int k) {
        this.k = k;
    }
}
